﻿/* 
 *  <copyright file="CGuid.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System;
using System.Collections.Generic;


/*
 * sector	// 0
{
	heightfloor = 0;
	heightceiling = 128;
	texturefloor = "GREENGRID";
	textureceiling = "-";
	lightlevel = 192;
}
 */ 
namespace SobrietyEngine.UDMF
{
    public class Sector : BaseUDMFObject
    {
        public String FloorTexture { get; set; }
        public String CeilingTexture { get; set; }
        public float FloorHeight { get; set; }
        public float CeilingHeight { get; set; }
        public Int32 LightLevel { get; set; }

        public List<Sidedef> Sidedefs { get; set; }
        public List<List<Vertex>> ContourVerts { get; set; }

        public Dictionary<String, String> Data { get; private set; }

        public Sector()
        {
            Sidedefs = new List<Sidedef>();
            ContourVerts = new List<List<Vertex>>();
        }

        override public void Read(Dictionary<String,String> kvps)
        {
            FloorTexture = kvps["texturefloor"];
            CeilingTexture = kvps["textureceiling"];
            LightLevel = Int32.Parse(kvps["lightlevel"]);
            FloorHeight = float.Parse(kvps["heightfloor"]);
            CeilingHeight = float.Parse(kvps["heightceiling"]);

            Data = kvps;
        }
    }
}